<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <title></title>

    <link rel="stylesheet" type="text/css" href="__CSS__/homePage.css" />
    <link rel="stylesheet" type="text/css" href="__CSS__/tooltip.css" />
    <script src="https://apps.bdimg.com/libs/jquery/2.1.4/jquery.min.js"></script>
    <script src="https://cdn.jsdelivr.net/npm/vue@2.6.10/dist/vue.js"></script>
    <link rel="stylesheet" href="https://unpkg.com/element-ui@2.12.0/lib/theme-chalk/index.css">
    <script src="https://unpkg.com/element-ui@2.12.0/lib/index.js"></script>
    <script src="https://cdn.staticfile.org/axios/0.18.0/axios.min.js"></script>
    <script type="text/javascript" src="https://cdn.bootcss.com/qs/6.5.1/qs.min.js"></script>


</head>

<body>
    <div class="top">
        <div class="name">
            <a style="text-decoration: none;" href="{:url('index/getHomePage')}">
                <img src="__IMG__/header/logo.png" style="width:8em">
                <!--火花设计思维分享-->
            </a>
        </div>
        {if condition="!isset($_COOKIE['user']) "}
        <div class="login" style="margin-left: 50%;"><a href="{:url('index/login')}" style="font-size: 20px;">登录</a></div>
        <div class="register"><a href="{:url('index/register')}" style="font-size: 20px;">注册</a></div>

        {else/}

        <!--添加成员的消息通知-->
        <div onclick="window.location.href='{:url('index/showPrjMemRequests')}'" class="request_banner" style="display: none;"></div>


        <div class="login"><a id="header_projects" href="{:url('index/getProjects',array('userId'=>$_COOKIE['user']))}" style="font-size: 20px;">项目小组</a></div>


        <div class="register"><a id="header_methods" href="{:url('index/getDesignMethods')}" style="font-size: 20px;">设计方法</a></div>
        <div class="register"><a id="header_cases" href="{:url('index/getPublicCanvasLists')}" style="font-size: 20px;">创意社区</a></div>
        <div class="register"><a id="header_ques" href="{:url('index/getSingleQuesBank')}" style="font-size: 20px;">题库练习</a></div>


        <div class="welcome_banner" style="z-index:105;" onmouseover="$('#logout').show()" onmouseout="$('#logout').hide()">
            <svg style="margin-left:65px;" t="1573030732563" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2246" width="40" height="40">
                <path d="M512 950.857143c241.371429 0 438.857143-197.485714 438.857143-438.857143s-197.485714-438.857143-438.857143-438.857143-438.857143 197.485714-438.857143 438.857143 197.485714 438.857143 438.857143 438.857143z m0 73.142857c-285.257143 0-512-226.742857-512-512s226.742857-512 512-512 512 226.742857 512 512-226.742857 512-512 512z" fill="#e45440" p-id="2247">

                </path>
                <text x="50%" y="65%" style="fill:#e45440;font-size:550px;text-anchor: middle;">
                    {:iconv_substr($_COOKIE['username'],0,1)}
                </text>
            </svg>


            <div id="logout">
                <div class="logout_top">
                    <text class="logout_user">{$_COOKIE['username']}</text>
                    <br>
                    <text class="logout_id">ID: {$_COOKIE['user']}</text>
                </div>

                <div class="logout_option">
                    <a href="{:url('index/showPrjMemRequests')}">我的消息</a>
                </div>

                <div class="logout_option">
                    <a href="{:url('index/logout')}">登出</a>
                </div>

                <div style="height: 6px;width: 100%;border-radius: 4px;"></div>
            </div>

            <svg style="float: right;margin-right: 30px;" t="1573118997341" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2175" width="15" height="40"><path d="M972.838375 233.161725c15.319322 15.477939 27.804007 28.100774 43.005646 43.46103-167.688762 171.229501-334.75329 341.814301-503.593304 514.220637C343.610253 619.265957 176.069875 448.809074 8.155979 277.978674c15.140239-13.528486 28.904092-25.828971 36.456303-32.582981C102.486983 299.970139 164.429441 355.920971 223.562844 414.706441c90.002299 89.475281 178.423545 180.552081 266.599191 271.833548 16.09194 16.659891 25.511737 17.96976 42.483746 0.450267 139.874522-144.366961 280.757028-287.756638 421.235317-431.540299C960.33834 248.844331 965.900165 241.36887 972.838375 233.161725z" p-id="2176"></path></svg>

        </div>
        {/if}
    </div>
    <!--
{if condition="!isset($_COOKIE['user']) "}
<a href="{:url('index/login')}">登录</a>
{else/}<a href="{:url('index/logout')}">登出</a>
<a href="{:url('index/getProjects',array('userId'=>$_COOKIE['user']))}">项目</a>
{/if}-->

    <script>
        $.ajax({
            type: "GET",
            url: "__PUBLIC__/index/index/getPrjMemRequests",
            data: {},
            xhrFields: {
                withCredentials: true
            },
            //crossDomain: true,
            success: function(result) {
                if (result != null && (result.request_list.length > 0 || result.reject_list.length > 0)) {
                    $(".request_banner").show();
                    $(".request_banner").html("<a style='cursor: pointer;'>-您有" + (result.request_list.length + result.reject_list.length) + "条消息-</a>");
                }
            }
        });

        /*$.get('__PUBLIC__/index/index/getPrjMemRequests',{},function (result) {
            if(result != null && ( result.request_list.length > 0 || result.reject_list.length > 0) ) {
                $(".request_banner").show();
                $(".request_banner").html("<a>-您有" + ( result.request_list.length + result.reject_list.length ) + "条消息-</a>");
            }
            //$(".request_banner").load(location.href + " .request_banner");
        });*/
    </script>
</body>

</html>